package com.example.chcrm.entity.vehicle;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author 邹
 * @Date 2025/4/26 14:50
 * @Version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class VehicleDeployCarCv implements Serializable, Cloneable {
    private static final long serialVersionUID = 1L;

    /**
     * 0未出库，1已装车/已装船 2已到达成
     */
    public static final int STATE_00 = 0;
    public static final int STATE_01 = 1;
    public static final int STATE_02 = 2;

    @TableField(exist = false)
    private Integer page = 1;
    @TableField(exist = false)
    private Integer rows = 10;

    @TableId(value = "id", type = IdType.INPUT)
    private String id;

    private String playId;      //计划id
    private String carId;       //计划中委托车id

    private Integer type;       //运输工具类型  0:运输车运输 1船舶运输
    private String billNumber;  //运单号(系统随机生成的)
    private String basicId;             //公路、水路主调配id
    //委托车信息
    @Excel(name = "批次号",width = 40)
    private String batchNumber; //批次号
    @Excel(name = "运单编号",width = 40)
    private String waybillNo;   //运单编号（计划中的运单编号）
    @Excel(name = "车架号",width = 40)
    private String frameNumber; //车架号
    private String brandId;     //品牌id
    @Excel(name = "品牌",width = 40)
    private String brand;       //品牌
    private String modelId;     //型号id
    @Excel(name = "型号",width = 40)
    private String model;       //型号
    private String config;      //配置
    private String color;       //颜色
    @Excel(name = "重量",width = 10)
    private Double weight;      //重量
    private String lwh;         //长宽高
    //分配供应商信息
    private String supplierId;      //供应商id
    private String supplierName;    //供应商名称
    //运输车或船舶信息
    private String personnelId;     //运输车或船舶id
    private String personnelName;   //运输车或船舶名称

    @Excel(name = "航次",width = 30)
    private String voyageNumber;        //航次名
    //装车位置
    private Integer startType;      //起始类型 0：区域 1：港口
    private String startId;         //起始地id
    private String startFullId;     //起始地id(包含父级id)
    private String startName;       //起始地区域名称
    private String startCoordinate; //装车坐标
    private String startPortId;     //起始港id
    @Excel(name = "起始港",width = 30)
    private String startPortName;   //起始港名
    @TableField(exist = false)
    @Excel(name = "目的港",width = 40)
    private String arrivePort; //计划中的目的港
    //交车位置
    private Integer deliveryType;       //交车类型 0：区域 1：港口
    private String deliveryId;          //交车位置id
    private String deliveryFullId;      //交车位置id(包含父级id)
    private String deliveryName;        //交车位置区域名称
    private String deliveryCoordinate;  //交车位置坐标
    @TableField(updateStrategy= FieldStrategy.IGNORED)
    private String deliveryPortId;      //交车港id
    @TableField(updateStrategy=FieldStrategy.IGNORED)
    @Excel(name = "交车港",width = 30)
    private String deliveryPortName;    //交车港名
    //时间管理
    @Excel(name = "装车时间",width = 30,format ="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date loadingDate;   //装车时间
    @TableField(exist = false)
    private String loadingDates;//装车时间
    @Excel(name = "交车时间",width = 30,format ="yyyy-MM-dd HH:mm:ss")
    private Date deliveryDate;  //交车时间
    @TableField(exist = false)
    private String deliveryDates;  //交车时间

    private String remark;      //备注
    @Excel(name = "状态",width = 20,replace = {"待装车_0","已装车/已装船_1","已交车_2","已取消_-1"})
    private Integer state;          //状态    0：待装车 1：已装车、已装船  2：已交车 -1:已取消 3:交叉过驳状态
    @TableLogic(value = "0", delval = "-1")
    private Integer isDeleted;  //是否删除  0：否 -1：是
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;    //创建时间

    @TableField(exist = false)
    private String driverId;


    @TableField(exist = false)
    private String loadingType;//装车类型0：正常装车1：过驳2：转船

    @TableField(exist = false)
    private String unloadType;//装车类型0：正常卸车1：过驳2：转船

    @TableField(exist = false)
    private String damage;//是否质损 0：否 1：是


    @TableField(exist = false)
    private String stateType;          //状态    0：待装车 1：已装车、已装船  2：已交车 -1:已取消

    @TableField(exist = false)
    private Integer seeType;//查看类别
    @TableField(exist = false)
    private List<Map<String,String>> carIdList;
    @TableField(exist = false)
    private List<VehicleDeployCarCv> vdcclist;
    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
    @TableField(exist = false)
    private String waybillNo2;

    @TableField(exist = false)
    private String omId;

    @TableField(exist = false)
    private String taskPeople;
    @TableField(exist = false)
    private String organizationCode;

    @TableField(exist = false)
    private String pickCar;
    @TableField(exist = false)
    private Integer number;
    @TableField(exist = false)
    private String line;
    @TableField(exist = false)
    private String startDate;
    @TableField(exist = false)
    private String endDate;
    @TableField(exist = false)
    private  Integer isImport;
    @TableField(exist = false)
    private String ids;
    private Integer partYearMonth = Integer.parseInt(new SimpleDateFormat("yyyyMM").format(new Date()));//分区年月
}
